/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author solriver
 */
@Embeddable
public class GroupRecordPK implements Serializable {

	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @Column(name = "mie_id_miembro")
    private int idMember;
    @Basic(optional = false)
    @Column(name = "gru_id_grupo_familiar")
    private int idFamilyGroup;

    public GroupRecordPK() {
    }

    public GroupRecordPK(int idMember, int idFamilyGroup) {
        this.idMember = idMember;
        this.idFamilyGroup = idFamilyGroup;
    }

    public int getIdMember() {
        return idMember;
    }

    public void setIdMember(int idMember) {
        this.idMember = idMember;
    }

    public int getGruIdFamilyGroup() {
        return idFamilyGroup;
    }

    public void setGruIdFamilyGroup(int idFamilyGroup) {
        this.idFamilyGroup = idFamilyGroup;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idMember;
        hash += (int) idFamilyGroup;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GroupRecordPK)) {
            return false;
        }
        GroupRecordPK other = (GroupRecordPK) object;
        if (this.idMember != other.idMember) {
            return false;
        }
        if (this.idFamilyGroup != other.idFamilyGroup) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.HistorialGrupoPK[ mieIdMiembro=" + idMember + ", gruIdGrupoFamiliar=" + idFamilyGroup + " ]";
    }
    
}
